/* reset */

.select2-container {
    min-width: 100%;
    .select2-selection--single,
    .select2-selection--multiple {
        height: 32px;
        min-height: 30px;
        &:focus {
            outline: none;
        }
    }
}

.qor-page__header {
    .select2-container:not(.qor-advanced-filter .select2-container) {
        width: 100% !important;
        max-width: 260px;
        .select2-dropdown--below {
            max-width: 260px;
            width: auto !important;
        }
    }
}

[chooser-selected='true'][data-allow-clear='true'] {
    & + .select2-container--default {
        .select2-selection--single {
            border-color: unquote('rgb(#{$color-primary})');
            .select2-selection__rendered {
                padding-right: 50px;
            }
            .select2-selection__arrow {
                right: 29px;
            }
        }
    }
}

.select2-container--default {
    &.select2-container--focus {
        .select2-selection--multiple {
            border-radius: 2px;
            border: 2px solid #2196f3;
        }
    }
    &.select2-container--open {
        .select2-selection--single .select2-selection__arrow {
            b {
                border-width: 0 4px 4px;
            }
        }
    }
    .select2-selection--multiple {
        border-radius: 2px;
        border: 2px solid unquote('rgba(#{$color-black}, 0.12)');
        height: auto;
        margin-top: 0;
        line-height: 1;
        .select2-selection__clear {
            font-size: 20px;
            padding: 0 8px;
            margin: 0;
            line-height: 28px;
            position: absolute;
            top: 2px;
            right: 2px;
        }
        .select2-selection__choice {
            padding: 0 6px 0px 2px;
            color: rgba(0, 0, 0, 0.87);
            background-color: unquote('rgba(#{$color-black}, 0.08)');
            background-image: none;
            border-color: unquote('rgba(#{$color-black}, 0.12)');
            border-radius: 2px;
            box-shadow: none;
            margin-top: 3px;
            line-height: 20px;
        }
        .select2-selection__choice__remove {
            line-height: 1;
            float: right;
            margin: 4px 0 0 8px;
        }
    }
    .select2-selection--single {
        border-radius: 2px;
        border: 2px solid unquote('rgba(#{$color-black}, 0.12)');
        .select2-selection__placeholder {
            color: unquote('rgba(#{$color-black}, 0.54)');
        }
        .select2-selection__rendered {
            padding-right: 30px;
            font-weight: 500;
        }
        .select2-selection__arrow {
            height: 30px;
            width: 24px;
            top: 1px;
            b {
                border-width: 4px 4px 0;
            }
        }
        .select2-selection__clear {
            font-size: 20px;
            padding: 0 8px;
            margin-right: -50px;
            margin-left: 8px;
            background-color: unquote('rgb(#{$color-primary})');
            color: #fff;
        }
    }
    .select2-results__option--highlighted[aria-selected] {
        background-color: unquote('rgb(#{$color-primary})');
    }
    .select2-search--inline {
        float: left !important;
        .select2-search__field {
            width: 90% !important;
        }
    }
}

.select2-dropdown {
    border: 0;
    @include shadow-2dp();
    .select2-results__option {
        height: 48px;
        padding: 0 16px;
        line-height: 48px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        &[aria-selected='true'] {
            display: none;
        }
    }
}

.select2-container--disabled {
    .select2-selection__clear,
    .select2-selection__arrow {
        &:hover {
            background-color: transparent !important;
            b {
                border-color: #888 transparent transparent !important;
            }
        }
    }
    .select2-selection--single {
        border-color: unquote('rgba(#{$color-black}, 0.12)');
        .select2-selection__rendered {
            color: unquote('rgba(#{$color-black}, 0.24)');
        }
    }
}
